package com.atguigu.gmall.order.rpc;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.order.biz.OrderBizService;
import com.atguigu.gmall.order.vo.OrderSpiltResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author lfy
 * @Description
 * @create 2023-08-07 9:20
 */
@RequestMapping("/api/order")
@RestController
public class OrderSpiltController {

    @Autowired
    OrderBizService orderBizService;

    /**
     * 拆单
     * @return
     */
    @PostMapping("/orderSplit")
    public List<OrderSpiltResultVo> orderSpilt(@RequestParam("orderId") Long orderId,
                                               @RequestParam("wareSkuMap") String wareSkuMap){



        List<OrderSpiltResultVo> resultVos = orderBizService.spiltOrder(orderId,wareSkuMap);

        return resultVos;
    }
}
